At 22:48 +0200 on 11/3/99, Ralf Weidemann wrote:
>
> how could I do an automatic daily check
> to delete some expired data ? I mean
> can I have a cron functionality in post-
> gresql ?
You don't need to have cron functionality in postgresql when you have cron
functionality in cron. :)
What you have to do is make a simple script, more or less like this:
#!/usr/bin/sh
PGHOST=...
PGPORT=...
PGUSER=...
psql my_database <<END_SQL
DELETE FROM table_in_question
WHERE datetime_field < ( 'now'::datetime - '1 day'::timespan );
END_SQL
And then run it with cron...
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma